package cn.snowheart.learn.mybatis.entity;

import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.StringTypeHandler;
import tk.mybatis.mapper.annotation.ColumnType;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.annotation.NameStyle;
import tk.mybatis.mapper.annotation.Version;
import tk.mybatis.mapper.code.Style;
import tk.mybatis.mapper.genid.GenId;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @author liuwanxiang
 * @version 2019/04/28
 */
@Getter
@Setter
@NameStyle(Style.camelhumpAndLowercase)
@Table(name = "house")
public class House {

    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer id;

    @Column(name = "house_address")
    private String houseAddress;

    @ColumnType(column = "owner_name", jdbcType = JdbcType.VARCHAR, typeHandler = StringTypeHandler.class)
    private String ownerName;

    @Transient
    private Double price;

    @Version
    private Integer version;

}
